using System;
using System.Collections.Generic;
using NHibernate.Mapping.Attributes;
using A = NHibernate.Mapping.Attributes;

namespace SuperMarketManagement.Entity
{

    [Class(Name = "ProductBlock")]
    public class ProductBlock
    {
        [Id(1, Name = "AutoId"), Generator(2, Class = "native")]
        public virtual long AutoId { get; set; }
        [Property]
        public virtual double Cost { get; set; }
        [Property]
        public virtual double AvailableUnits { get; set; }
        [Property]
        public virtual double PurchasedUnits { get; set; }
        [Property]
        public virtual DateTime PurchasedDate { get; set; }

        [ManyToOne(Column = "ProductAutoId")]
        public virtual Product Product { get; set; }

        public ProductBlock()
        {
        }

        public ProductBlock(double cost, DateTime purchasedDate, double purchasedUnits, double availableUnits)
            : this()
        {
            Cost = cost;
            PurchasedDate = purchasedDate;
            PurchasedUnits = purchasedUnits;
            AvailableUnits = availableUnits;
        }
    }
}